package com.app.micaihu.adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;

import com.app.micaihu.R;
import com.app.micaihu.base.AppBaseAdapter;
import com.app.micaihu.bean.news.NewsEntity;
import com.app.micaihu.bean.news.ViewVideo;
import com.app.micaihu.configure.Config;
import com.app.micaihu.utils.MobclickAgentUtils;

import java.util.List;

/**
 * 视频列表适配器
 * Created by linkai on 2016/9/7.
 */
public class VideoAdapter extends AppBaseAdapter<NewsEntity> {

    public VideoAdapter(List<NewsEntity> list, Context context) {
        super(list, context);
    }

    @Override
    public View creatView(int position, View convertView, ViewGroup parent) {
        ViewVideo viewholder;
        if (convertView == null) {
            convertView = inflater.inflate(R.layout.item_videolist, null);
            viewholder = new ViewVideo(convertView);
            convertView.setTag(viewholder);
        } else {
            viewholder = (ViewVideo) convertView.getTag();
        }
        NewsEntity newsEntity = list.get(position);
        if (newsEntity == null) {
            return convertView;
        }
        viewholder.loadData(newsEntity);
        return convertView;
    }
}
